package day005;

public class Student {
    int id;
      String sno;
    String name;

    public Student() {
        this.id = id;
        this.name = name;
    }



    public Student(int id, String sno, String name) {
        this.id = id;
        this.sno = sno;
        this.name = name;
    }

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("Student{");
        sb.append("id=").append(id);
        sb.append(", sno='").append(sno).append('\'');
        sb.append(", name='").append(name).append('\'');
        sb.append('}');
        return sb.toString();
    }
    public void setId(int id){
        this.id = id;
    }
    public void setSname(String sname) {
        //字符串的比较使用java.lang.String类中提供的equals方法
        //setter方法可以对参数进行有效性判断

        this.name = sname;
    }
}

